1. Field of the Present Invention
The present invention generally relates to the field of computer graphics and more particularly to a system and method adapted for converting pixel data between various pixel data formats.
2. History of Related Art
Graphics display subsystems are almost universally encountered in microprocessor based computer systems to facilitate a variety of graphics tasks and applications. Graphics processors, graphics adapters, and a variety of similarly designed computer products provide specialized hardware to speed the execution of graphics instructions and the rendering of graphic images. These processors and adapters typically include, for example, circuitry optimized for displaying images. The rendering process includes the process of specifying attributes for each pixel in a particular display device.
Unfortunately, graphics applications software and graphics hardware do not always utilize the same pixel data format. When differences in pixel data format are encountered, it is the responsibility of the graphics adapter to reconcile the formatting differences between pixel data presented to the adapter and pixel data stored in a frame buffer by the adapter. Conventionally, rather crude methods of achieving this reconciliation have been used in which every pixel data format supported by the adapter is declared or enumerated and hardware or software facilities for reconciling each supported format are implemented in the adapter. Moreover, prior methods of transforming data values from one format to another have been traditionally accomplished with simplistic approaches that unnecessarily distort the image upon transformation to the frame buffer format. Accordingly, it would be highly desirable to implement a graphics adapter and method that could flexibly accommodate or support a wide variety of pixel data format and that could produce a format transformation that minimizes distortion of the original graphic image data.
The problems identified above are in large part by a graphics adapter and method for supporting a wide variety of host pixel data formats without significantly increasing the cost or complexity of the design. In addition the invention contemplates a data replication technique in conjunction with the format transformation process that minimizes transformation distortion. These benefits are achieved through the use of programmable facilities that determine the format of host pixel data and, thereafter, transform the host pixel data to a format suitable for a frame buffer.
Broadly speaking, the invention contemplates, a computer system and an associated graphics adapter. The computer system includes one or more processors connected to a host bus. A system memory is accessible from the host bus via a memory controller and an I/O bridge is coupled between the host bus and an I/O bus. The computer system further includes a frame buffer suitable for storing a representation of a graphic image and the graphics adapter connected to the I/O bus. The graphics adapter includes means for receiving host pixel data that is formatted, according to a host format defining the ordering and width of a set of host components, as a set of host component values. The adapter also has means for transforming the host pixel data into frame buffer pixel data where the frame buffer pixel data is formatted, according to a frame buffer format defining the ordering and width of a set of frame buffer components, as a set of frame buffer component values. In the preferred embodiment, the value of each host pixel data component is replicated in a corresponding component of the frame buffer pixel data by repeating the bits comprising the value in the corresponding frame buffer component until the frame buffer component is full. In the preferred embodiment, the transforming means includes a programmable set of format definition registers that define the relationship between the host format and the frame buffer format. These registers preferably include a start bit register and a width register for each component of the data. The component data widths are permitted to vary from one another in the preferred embodiment such that a first component of the host pixel data could have one width while a second component has another (different) width. The adapter preferably further includes means for scaling and biasing the frame buffer pixel data and means for transforming (packing) frame buffer pixel data into host pixel data.
The invention further contemplates a method of processing pixels in which host pixel data is received and transformed into frame buffer pixel data. The host pixel data is formatted, according to a host format defining the ordering and width of the host components, as a set of host component values. The frame buffer pixel data is formatted, according to a frame buffer format defining the ordering and width of the frame buffer components, as a set of frame buffer component values. The frame buffer pixel data is then forwarded to a frame buffer and ultimately displayed on a display device. The transforming preferably includes replicating the value of each host component in a corresponding component of the frame buffer pixel data by repeating the bits that comprise the value in the corresponding frame buffer component until the frame buffer component is full. In the preferred embodiment, the transforming includes programming a set of host format definition registers prior to receiving the host pixel data. The method further includes scaling and biasing the frame buffer pixel data and transforming frame buffer pixel data to host pixel data and forwarding the host pixel data back to the host.